<!DOCTYPE HTML>
<html style="width:100%;height:100%">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>321 StudentInformation</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" href="../../css/font-awesome.min.css">
</head>

<body style="width:100%;height:100%;background-color:#FFF;">
    <header class="aui-bar aui-bar-nav aui-bar-light;" style="height:2.5rem!important;padding-top:0.75rem;background-color:#FFF!important;">
        <a class="aui-pull-left aui-btn" onclick="api.closeWin()">
            <i style="color:black" class="fa fa-chevron-left" aria-hidden="true"></i>
        </a>
        <div class="aui-title" style="color:#000;font-weight:bored;font-size:1rem">学生信息</div>
        <a class="aui-pull-right">
            <span>
                <img src="../../icon/header.png" style="padding-top:0.25rem">
            </span>
        </a>
    </header>


    <div style="background-image:url(../../image/flag.png);height:11rem;">
        <div style="padding-top:1rem; text-align:right;position:flex">
            <div style="position:absolute; width:1.5rem;height:1.5rem;right:0rem;color:white" @click="edit()"><img
                    style="width:1.5rem;height:1.5rem" src="../../image/edit.png"></div>

        </div>

        <img src="../../icon/qq.png" style="margin:auto;width:4rem;height:4rem;border-radius:2rem;">
        <div class="aui-media-list-item-inner">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-text" style="margin-top:0.5rem;">
                    <div class="aui-list-item-text" style="margin:auto;color:#fff; margin-left:0.5rem">姓名：{{student.name}}</div>
                    <div v-if="student.gender==0" class="aui-list-item-text" style="margin:auto;color:#fff; margin-left:0.5rem">性别：男</div>
                    <div v-else class="aui-list-item-text" style="margin:auto;color:#fff; margin-left:0.5rem">性别：女</div>
                    <div class="aui-list-item-text" style="margin:auto;color:#fff; margin-left:0.5rem">家庭住址：{{student.homeAddr}}</div>
                </div>
            </div>
        </div>
    </div>

    <div class="aui-content aui-margin-b-25">
        <li @click="changetoSFM()" class="aui-media-list-item-inner aui-col-xs-12" style="height:2.5rem;border: 0.05rem solid #c5c5c5;background-color: #FFF;">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="margin:auto;padding-left: 0.5rem;">
                    <img src="../../icon/family.png" style="width: 30px; height:30px ;">
                </div>
                <div class="aui-list-item-inner aui-list-item-arrow" style="margin:auto;padding-left:0.5rem;">
                    主要家庭成员
                </div>
            </div>
        </li>
        <li class="aui-media-list-item-inner aui-col-xs-6" style="height: 2.5rem;border-bottom: 0.05rem solid #c5c5c5;border-right: 0.05rem solid #c5c5c5;background-color: #FFF;">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="margin:auto;padding-left: 0.5rem;">
                    <img src="../../icon/class.png" style="width:30px;height:30px;">
                </div>
                <div class="aui-list-item-inner" style="margin: auto;padding-left:0.5rem;">
                    <div class="aui-list-item-text">
                        <div class="aui-list-item-title aui-font-size-14">班级</div>
                    </div>
                    <div class="aui-list-item-text">
                        {{student.clazz}}
                    </div>
                </div>
            </div>
        </li>
        <li class="aui-media-list-item-inner aui-col-xs-6" style="height: 2.5rem;border-bottom: 0.05rem solid #c5c5c5;border-right: 0.05rem solid #c5c5c5;background-color: #FFF;">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="margin:auto;padding-left: 0.5rem;">
                    <img src="../../icon/nation.png" style="width:30px;height:30px;">
                </div>
                <div class="aui-list-item-inner" style="margin: auto;padding-left: 0.5rem;">
                    <div class="aui-list-item-text">
                        <div class="aui-list-item-title aui-font-size-14">民族</div>
                    </div>
                    <div class="aui-list-item-text">
                        {{student.nation.itemValue}}
                    </div>
                </div>
            </div>
        </li>
        <li class="aui-media-list-item-inner aui-col-xs-6" style="height: 2.5rem;border-bottom: 0.05rem solid #c5c5c5;border-right: 0.05rem solid #c5c5c5;background-color: #FFF;">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="margin:auto;padding-left: 0.5rem;">
                    <img src="../../icon/dormitory.png" style="width:30px;height:30px;">
                </div>
                <div class="aui-list-item-inner" style="margin: auto;padding-left: 0.5rem;">
                    <div class="aui-list-item-text">
                        <div class="aui-list-item-title aui-font-size-14">宿舍号</div>
                    </div>
                    <div class="aui-list-item-text">
                        {{student.susheSno}}
                    </div>
                </div>
            </div>
        </li>
        <li class="aui-media-list-item-inner aui-col-xs-6" style="height: 2.5rem;border-bottom: 0.05rem solid #c5c5c5;border-right: 0.05rem solid #c5c5c5;background-color: #FFF;">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="margin:auto;padding-left: 0.5rem;">
                    <img src="../../icon/qq.png" style="width:30px;height:30px;">
                </div>
                <div class="aui-list-item-inner" style="margin: auto;padding-left: 0.5rem;">
                    <div class="aui-list-item-text">
                        <div class="aui-list-item-title aui-font-size-14">QQ号</div>
                    </div>
                    <div class="aui-list-item-text">
                        {{student.qq}}
                    </div>
                </div>
            </div>
        </li>
        <li class="aui-media-list-item-inner aui-col-xs-6" style="height: 2.5rem;border-bottom: 0.05rem solid #c5c5c5;border-right: 0.05rem solid #c5c5c5;background-color: #FFF;">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="margin:auto;padding-left: 0.5rem;">
                    <img src="../../icon/politics.png" style="width:30px;height:30px;">
                </div>
                <div class="aui-list-item-inner" style="margin: auto;padding-left: 0.5rem;">
                    <div class="aui-list-item-text">
                        <div class="aui-list-item-title aui-font-size-14">政治面貌</div>
                    </div>
                    <div class="aui-list-item-text">
                        {{student.zzmm}}
                    </div>
                </div>
            </div>
        </li>
        <li class="aui-media-list-item-inner aui-col-xs-6" style="height: 2.5rem;border-bottom: 0.05rem solid #c5c5c5;border-right: 0.05rem solid #c5c5c5;background-color: #FFF;">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="margin:auto;padding-left: 0.5rem;">
                    <img src="../../icon/stu_id.png" style="width:30px;height:30px;">
                </div>
                <div class="aui-list-item-inner" style="margin: auto;padding-left: 0.5rem;">
                    <div class="aui-list-item-text">
                        <div class="aui-list-item-title aui-font-size-14">学号</div>
                    </div>
                    <div class="aui-list-item-text">
                        {{student.sno}}
                    </div>
                </div>
            </div>
        </li>
        <li class="aui-media-list-item-inner aui-col-xs-12" style="height: 2.5rem;border-bottom: 0.05rem solid #c5c5c5;border-right: 0.05rem solid #c5c5c5;background-color: #FFF;">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="margin:auto;padding-left: 0.5rem;">
                    <img src="../../icon/IDcard.png" style="width:30px;height:30px;">
                </div>
                <div class="aui-list-item-inner aui-list-item-arrow" style="margin: auto;padding-left: 0.5rem;">
                    <div class="aui-list-item-text">
                        <div class="aui-list-item-title aui-font-size-14">身份证号</div>
                    </div>
                    <div class="aui-list-item-text">
                        {{student.idCard}}
                    </div>
                </div>
            </div>
        </li>
        <li class="aui-media-list-item-inner aui-col-xs-12" style="height: 2.5rem;border-bottom: 0.05rem solid #c5c5c5;border-right: 0.05rem solid #c5c5c5;background-color: #FFF;">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" style="margin:auto;padding-left: 0.5rem;">
                    <img src="../../icon/phone.png" style="width:30px;height:30px;">
                </div>
                <div class="aui-list-item-inner aui-list-item-arrow" style="margin: auto;padding-left: 0.5rem;"
                    accesskey="" @click="call()">
                    <div class="aui-list-item-text">
                        <div class="aui-list-item-title aui-font-size-14">联系电话</div>
                    </div>
                    <div class="aui-list-item-text">
                        {{student.phone}}
                    </div>
                </div>
            </div>
        </li>
    </div>

</body>

<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue1.0.js"></script>
<script type="text/javascript" src="../../script/util.js"></script>
<script type="text/javascript">
    apiready = function () {
        
        vm = new Vue(vueVonfig);

        api.addEventListener({
            name: 'viewappear'
        }, function (ret, err) {
            vm.get();
        });
    }

    function shuaxin() {
        var me = vm;
        api.ajax({
            url: serverIp + "/friend/getmsgfromoidStudent.do",
            method: 'post',
            data: {
                values: {
                    oid: me.student.oid
                }
            }
        }, function (ret, err) {
            if (ret) {
                var result = ret.data;
                me.student = result;
            } else {
                alert(JSON.stringify(err));
            }
        });
    }

    vueVonfig = {
        el: "body",
        data: {
            student: {},
            index: -1,
            oid: -1
        },
        created: function () {
            var me = this;
            me.index = api.pageParam["index"];
            var value = api.getPrefs({
                key: 'students',
                sync: true
            });
            result = JSON.parse(value);
            me.student = result[me.index];
            me.oid = me.student.oid;
            api.setPrefs({
                key: 'student',
                value: me.student
            });
        },
        methods: {
            call: function () {
                var me = this;
                api.call({
                    type: 'tel_prompt',
                    number: me.student.phone
                });
            },
            changetoSFM: function () {
                var me = this;
                api.openWin({
                    name: 'StudentFamilyMessage1',
                    url: './StudentFamilyMessage1.html',
                    pageParam: {
                        index: me.index
                    }
                });
            },
            edit: function () {
                var me = this;
                api.openWin({
                    name: 'changestudentmsg',
                    url: './changestudentmsg.html',
                    pageParam: {
                        student: me.student
                    }
                });
                me.get();
            },
            get: function () {
                var me = this;
                api.ajax({
                    url: serverIp + "/friend/getmsgfromoidStudent.do",
                    method: 'post',
                    data: {
                        values: {
                            oid: me.oid
                        },

                    }
                }, function (ret, err) {
                    if (ret) {
                        var result = ret.data;
                        me.student = result;
                    } else {
                        alert(JSON.stringify(err));
                    }
                });

            }
        }
    }
</script>

</html>